package com.yyb.learn.jbasics.basic.socket;

import org.springframework.util.SocketUtils;

import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.net.Socket;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;

/**
 * @Author yuyb40219
 * @Date 2021/10/20 15:58
 * Description:
 */
public class SocketUtil {
    public static void main(String[] args) {
        int availableTcpPort = SocketUtils.findAvailableTcpPort();
        int availableUdpPort = SocketUtils.findAvailableUdpPort();

        System.out.println("TCP PORT IS:" + availableTcpPort);
        System.out.println("UDP PORT IS:" + availableUdpPort);


    }

}